bugfix: skip lint when KB has no indexed documents#21
Merged
KylinMountain merged 2 commits intomainfrom Apr 12, 2026
Merged
Conversation
When the hash registry is empty (no documents added yet), lint would still run structural checks (all zero), call the LLM for knowledge lint (wasting an API call), write an empty report file, and log the operation. Now it exits early with a clear message instead.
Collaborator
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
1 similar comment
Collaborator
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
- Hoist the hashes check above _setup_llm_key/config/model so that an empty KB exits immediately without triggering API key warnings - Add missing assert result.exit_code == 0 in test_lint_runs_when_docs_exist
Mizelan
pushed a commit
to Mizelan/OpenKB
that referenced
this pull request
Apr 18, 2026
* Skip lint when knowledge base has no indexed documents
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
openkb lintwhen the hash registry is empty (no documents added yet)wiki/reports/, and log the operation"Nothing to lint — no documents indexed yet."and returns immediatelyTest plan
tests/test_lint_cli.py(201 total passing)openkb init && openkb lint— should show early-exit message, no report writtenopenkb add <file> && openkb lint— should run normally